Test your skills through the online practice test: EJB Quiz Online Practice Test

Related differences

EJB 1.0 vs EJB 2.0EJB 2.0 vs EJB 3.0EJB 3.0 vs Spring
JavaBeans vs EJB

Ques 51. What is the relationship between local interfaces and container-managed relationships?

Entity beans that have container-managed relationships with other entity beans, must be accessed in the same local scope as those related beans, and therefore typically provide a local client view. In order to be the target of a container-managed relationship, an entity bean with container-managed persistence must provide a local interface.

Is it helpful? Add Comment View Comments
 

Ques 52. What is EJBDoclet?

EJBDoclet is an open source JavaDoc doclet that generates a lot of the EJB related source files from custom JavaDoc comments tags embedded in the EJB source file.

Is it helpful? Add Comment View Comments
 

Ques 53. What is the difference between session and entity beans?

An entity bean represents persistent global data from the database; a session bean represents transient user-specific data that will die when the user disconnects (ends his session). Generally, the session beans implement business methods (e.g. Bank.transferFunds) that call entity beans (e.g. Account.deposit, Account.withdraw)

Is it helpful? Add Comment View Comments
 

Ques 54. What are Local Interfaces? Explain.

EJB was originally designed around remote invocation using the Java Remote Method Invocation (RMI) mechanism, and later extended to support to standard CORBA transport for these calls using RMI/IIOP. This design allowed for maximum flexibility in developing applications without consideration for the deployment scenario, and was a strong feature in support of a goal of component reuse in J2EE. Many developers are using EJBs locally, that is, some or all of their EJB calls are between beans in a single container. With this feedback in mind, the EJB 2.0 expert group has created a local interface mechanism. The local interface may be defined for a bean during development, to allow streamlined calls to the bean if a caller is in the same container. This does not involve the overhead involved with RMI like marshalling etc. This facility will thus improve the performance of applications in which co-location is planned. Local interfaces also provide the foundation for container-managed relationships among entity beans with container-managed persistence.

Is it helpful? Add Comment View Comments
 

Ques 55. Can Entity Beans have no create() methods?

Yes. In some cases the data is inserted NOT using Java application, so you may only need to retrieve the information, perform its processing, but not create your own information of this kind.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users: